package com.fruit.util;

import java.util.Calendar;

public class LogUtil
{
	/**
	 * 动态生成表名
	 * @param offset:偏移量，当前月份+偏移量得到偏移offset个月份的表名
	 */
	public static String generateLogTableName(int offset)
	{
		Calendar calendar=Calendar.getInstance();
		calendar.add(Calendar.MONTH, offset);
		int year=calendar.get(Calendar.YEAR);
		int month=calendar.get(Calendar.MONTH)+1;
		return "logs_"+year+"_"+month;
	}
	
}
